<!DOCTYPE html	PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui" xmlns:sdu="http://sduept.com/jsf/cc">
<h:head>
	<link href="/css/primefaces/menubase.css" rel="stylesheet" type="text/css" />
	<title>评价标准多选择器</title>
	<style type="text/css">
.value {
	font-weight: bold;
}
.ui-tree {
	width: 600px;
    position: relative;
    height: 500px;
    overflow-y: scroll;
}

</style>
</h:head>
<!-- 只显示当前可用的版本 -->
<!-- 在页面中 -->
<!-- 
	<p:commandButton value="选择评价标准" style="margin-left:5px"
		actionListener="#{standardSelectorController.openStandardSelectorDialog}" >
		<p:ajax event="dialogReturn" listener="#{对应的controller中的方法.onStandardsChosen}" />
	</p:commandButton>
 -->


<!-- 在自己对应的controller中增加如下方法 -->
<!-- 
	public void onStandardsChosen(SelectEvent event) {
		List<StandardInspection> standard = (List<StandardInspection>) event.getObject();
	}
 -->

	<h:body>
		<h:form id="toolbarForm">
			<p:toolbar id="toolbar">
				<f:facet name="left">
					<p:commandButton value="确定" ajax="false" style="margin-right:10px;"
						actionListener="#{standardSelectorController.selectStandards}"/>
				</f:facet>
			</p:toolbar>
		</h:form>
		<h:form id="treeForm">
			<p:tree id="standardTree" widgetVar="standardTree" dynamic="true" 
				animate="true" var="node" style="border:0"
				value="#{standardSelectorController.treeRoot}"
				selectionMode="checkbox" selection="#{standardSelectorController.selectedNodes}" >
				<p:ajax event="expand" update="treeForm:standardTree"  listener="#{standardSelectorController.onNodeExpand}" />
				<p:ajax event="select" listener="#{standardSelectorController.onStandardNodeSelect}" />
				<p:ajax event="unselect" listener="#{standardSelectorController.onStandardNodeUnSelect}" />
				 <p:treeNode type="ROOTNAME" icon="fa fa-file-word-o">
					<h:outputText value="#{node.content}" />
				</p:treeNode>
				<p:treeNode type="INSPECTIONPROJECT" icon="fa fa-files-o">
					<h:outputText value="#{node.content}" />
				</p:treeNode>
				<p:treeNode type="INSPECTIONITME" icon="fa fa-file-o">
					<h:outputText value="#{node.content}" />
				</p:treeNode>
				<p:treeNode type="INSPECTIONREQUIREMENT" icon="fa fa-file-text-o">
					<h:outputText value="#{node.content}" />
				</p:treeNode>
				<p:treeNode type="INSPECTIONCRITERION" icon="fa fa-star-o">
					<h:outputText value="#{node.content}" />
				</p:treeNode>
			</p:tree>
		</h:form>
	</h:body>
</html>
